package com.tenbent.product.center.role.bo;

import com.tenbent.product.base.bo.BizObject;
import com.tenbent.product.base.mybatis.annotations.TypeAlias;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 角色实体类
 *
 * @author Randy
 *
 *         Created by ThinkPad on 2017/9/1.
 */
@Entity
@Table(name = "pc_role")
@TypeAlias("role")
public class Role extends BizObject {

	/** 角色名称 */
	@Column(name = "role_name")
	private String roleName;

	/** 角色编码 */
	@Column(name = "role_code")
	private String roleCode;

	/** 角色描述 */
	@Column(name = "role_desc")
	private String roleDesc;

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getRoleCode() {
		return roleCode;
	}

	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}

	public String getRoleDesc() {
		return roleDesc;
	}

	public void setRoleDesc(String roleDesc) {
		this.roleDesc = roleDesc;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		Role role = (Role) o;

		if (roleName != null ? !roleName.equals(role.roleName) : role.roleName != null)
			return false;
		if (roleCode != null ? !roleCode.equals(role.roleCode) : role.roleCode != null)
			return false;
		return roleDesc != null ? roleDesc.equals(role.roleDesc) : role.roleDesc == null;

	}

	@Override
	public int hashCode() {
		int result = roleName != null ? roleName.hashCode() : 0;
		result = 31 * result + (roleCode != null ? roleCode.hashCode() : 0);
		result = 31 * result + (roleDesc != null ? roleDesc.hashCode() : 0);
		return result;
	}

	@Override
	public String toString() {
		return "Role{" + "roleName='" + roleName + '\'' + ", roleCode='" + roleCode + '\'' + ", roleDesc='" + roleDesc
				+ '\'' + '}';
	}
}
